From 5aacfef56353773b1c63e34559dc7dacd36ed375 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 22 Apr 2005 16:42:55 +0000 Subject: [PATCH] bitkeeper revision 1.1370 (4269298fN8pBqkwEJEdXf9MR8bXVzA) Add a headroom check to MMUEXT_REASSIGN_PAGE. Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 3caac3d167..82b3ab1fcd 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1686,11 +1686,19 @@ int do_mmuext_op( spin_lock(&d->page_alloc_lock); } - /* A domain shouldn't have PGC_allocated pages when it is dying. */ + /* + * Check that 'e' will accept the page and has reservation + * headroom. Also, a domain mustn't have PGC_allocated pages when + * it is dying. + */ + ASSERT(e->tot_pages <= e->max_pages); if ( unlikely(test_bit(DF_DYING, &e->d_flags)) || + unlikely(e->tot_pages == e->max_pages) || unlikely(IS_XEN_HEAP_FRAME(page)) ) { - MEM_LOG("Reassign page is Xen heap, or dest dom is dying."); + MEM_LOG("Transferee has no reservation headroom (%d,%d), or " + "page is in Xen heap (%p), or dom is dying (%d).\n", + e->tot_pages, e->max_pages, op.mfn, e->d_flags); okay = 0; goto reassign_fail; } -- 2.30.2